package spring.boot.async.jobs;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import spring.boot.async.service.TestService;

@Slf4j
@Component
public class DemoJob {

    @Autowired
    private TestService testService;

    @Scheduled(cron = "0/1 * * * * ?")
    public void info() {
        log.info("info   info   info=====================");
        testService.async();
    }

    @Scheduled(cron = "0/1 * * * * ?")
    public void debug() {
        log.debug("debug   debug   debug=====================");
        testService.async();
    }

    @Scheduled(cron = "0/1 * * * * ?")
    public void error() {
        log.error("error   error   error=====================");
        testService.async();
    }

    @Scheduled(cron = "0/1 * * * * ?")
    public void warn() {
        log.warn("warn   warn   warn=====================");
        testService.async();
    }

}
